/** Definition of the PLsets class.
 * @file 
 * @author Jeremy Schultz
 */

#ifndef	__PLSET_H_
#define	__PLSET_H_

#include <string>
#include <sstream>
#include <vector>
#include "Token.h"
#include "Word.h"
#include "Numeric.h"

using namespace std;

/** Describes the PL lanaguage for the sets
 * Base class for Follow or First sets. 
 */
class PLset	{
	public:
		/** The valid non-terminals.
		 * This is all the valid non-terminals used in the PL language.
		 */
		enum NonTerminal	{
			PROGRAM,
			BLOCK,
			DEFINITION_PART,
			DEFINITION,
			CONSTANT_DEFINITION,
			VARIABLE_DEFINITION,
			VARIABLE_DEFINITION1,
			TYPE_SYMBOL,
			VARIABLE_LIST,
			VARIABLE_NAME1,
			PROCEDURE_DEFINITION,
			STATEMENT_PART,
			STATEMENT,
			EMPTY_STATEMENT,
			READ_STATEMENT,
			VARIABLE_ACCESS_LIST,
			VARIABLE_ACCESS1,
			WRITE_STATEMENT,
			EXPRESSION_LIST,
			EXPRESSION1,
			ASSIGNMENT_STATEMENT,
			PROCEDURE_STATEMENT,
			IF_STATEMENT,
			DO_STATEMENT,
			GUARDED_COMMAND_LIST,
			GUARDED_COMMAND1,
			GUARDED_COMMAND,
			EXPRESSION,
			PRIMARY_EXPRESSION1,
			PRIMARY_OPERATOR,
			PRIMARY_EXPRESSION,
			PRIMARY_EXPRESSION11,
			RELATIONAL_OPERATOR,
			SIMPLE_EXPRESSION,
			NEGATIVE_SYMBOL,
			SIMPLE_EXPRESSION1,
			ADDING_OPERATOR,
			TERM,
			TERM1,
			MULTIPLYING_OPERATOR,
			FACTOR,
			VARIABLE_ACCESS,
			INDEXED_SELECTOR,
			CONSTANT,
			BOOLEAN_SYMBOL,
			NUMERAL,
			CONSTANT_NAME,
			VARIABLE_NAME,
			PROCEDURE_NAME,
			MAX_NON_TERMINALS
		};

		/** Constuctor.
		 */
		PLset();

		/** Constuctor.
		 * Create a PLset from set 1 and set 2
		 * @param s1	set 1
		 * @param s2	set 2
		 */
		PLset(PLset* s1, PLset* s2);

		/** Add a Token to the set.
		 * @param terminal	The terminal to add the set
		 */
		void PLset::add(Token::Token *terminal);

		/** Getter - set.
		 * @return A vector (set)
		 */
		vector<Token*> Set();

		/** Check if the set has the token .
		 * @param token		The token to look for
		 * @return true if token is in the set, otherwise false
		 */
		bool PLset::has(Token::Token *token);

		/** A String representation of the set.
		 * @return A string
		 */
		string toString();

	private:
		vector<Token*> set;		/**< A vector to represent a set */
};
#endif

